home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_gtk / BIN / GTK-CONF.{__ < prev   
Text File  |  1999-09-17  |  2KB  |  121 lines

  1. #!/bin/sh
  2.  
  3. glib_libs="-L/usr/local/glib/lib -rdynamic -lgmodule -lglib -ldl"
  4. glib_cflags="-I/usr/local/glib/lib/glib/include -I/usr/local/glib/include"
  5. glib_thread_libs="-L/usr/local/glib/lib -rdynamic -lgmodule -lgthread -lglib -lpthread -ldl"
  6. glib_thread_cflags="-I/usr/local/glib/lib/glib/include -I/usr/local/glib/include -D_REENTRANT"
  7.  
  8. prefix=/usr/local/gtk
  9. exec_prefix=${prefix}
  10. exec_prefix_set=no
  11.  
  12. usage()
  13. {
  14.     cat <<EOF
  15. Usage: gtk-config [OPTIONS] [LIBRARIES]
  16. Options:
  17.     [--prefix[=DIR]]
  18.     [--exec-prefix[=DIR]]
  19.     [--version]
  20.     [--libs]
  21.     [--cflags]
  22. Libraries:
  23.     gtk
  24.     gthread
  25. EOF
  26.     exit $1
  27. }
  28.  
  29. if test $# -eq 0; then
  30.     usage 1 1>&2
  31. fi
  32.  
  33. lib_gtk=yes
  34.  
  35. while test $# -gt 0; do
  36.   case "$1" in
  37.   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  38.   *) optarg= ;;
  39.   esac
  40.  
  41.   case $1 in
  42.     --prefix=*)
  43.       prefix=$optarg
  44.       if test $exec_prefix_set = no ; then
  45.         exec_prefix=$optarg
  46.       fi
  47.       ;;
  48.     --prefix)
  49.       echo_prefix=yes
  50.       ;;
  51.     --exec-prefix=*)
  52.       exec_prefix=$optarg
  53.       exec_prefix_set=yes
  54.       ;;
  55.     --exec-prefix)
  56.       echo_exec_prefix=yes
  57.       ;;
  58.     --version)
  59.       echo 1.2.3
  60.       ;;
  61.     --cflags)
  62.       echo_cflags=yes
  63.       ;;
  64.     --libs)
  65.       echo_libs=yes
  66.       ;;
  67.     gtk)
  68.       lib_gtk=yes
  69.       ;;
  70.     gthread)
  71.       lib_gthread=yes
  72.       ;;
  73.     *)
  74.       usage 1 1>&2
  75.       ;;
  76.   esac
  77.   shift
  78. done
  79.  
  80. if test "$echo_prefix" = "yes"; then
  81.     echo $prefix
  82. fi
  83.  
  84. if test "$echo_exec_prefix" = "yes"; then
  85.     echo $exec_prefix
  86. fi
  87.  
  88. if test "$lib_gthread" = "yes"; then
  89.       glib_cflags="$glib_thread_cflags"
  90.       glib_libs="$glib_thread_libs"
  91. fi
  92.  
  93. if test "$echo_cflags" = "yes"; then
  94.       if test ${prefix}/include != /usr/include ; then
  95.         includes=-I${prefix}/include
  96.         for i in $glib_cflags ; do
  97.           if test $i = -I${prefix}/include ; then
  98.             includes=""
  99.           fi
  100.         done
  101.       fi
  102.       echo $includes  -I/usr/X11R6/include $glib_cflags
  103. fi
  104.  
  105. if test "$echo_libs" = "yes"; then
  106.       my_glib_libs=
  107.       libdirs=-L${exec_prefix}/lib
  108.       for i in $glib_libs ; do
  109.         if test $i != -L${exec_prefix}/lib ; then
  110.           if test -z "$my_glib_libs" ; then
  111.             my_glib_libs="$i"
  112.           else
  113.             my_glib_libs="$my_glib_libs $i"
  114.           fi
  115.         fi
  116.       done
  117.  
  118.       echo $libdirs   -L/usr/X11R6/lib -lgtk -lgdk $my_glib_libs -lintl -lXext -lX11   -lm
  119. fi      
  120.  
  121.